package com.kclm.se.generic;

public class GenericMethodDemo {

	public static void main(String[] args) {
		// todo 
		int result = compare("jack", "ann");
		if(result > 0) {
			System.out.println("字符串jack比ann大");
		}
		
		result = compare(100, 2);
		if(result > 0) {
			System.out.println("100 比2 大");
		}
	}
	
	/****
	 * 比较两个对象的大小
	 * @param <T>
	 * @param a
	 * @param b
	 * @return
	 */
	public static <T extends Comparable<? super T>> int compare(T a, T b) {
		//
		return a.compareTo(b);
	}
}
